<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<script src="/assets/lib/jquery.js"></script>
</head>

<body>
	<script>
		var obj = {
			id1: 1,
			name1: 'jack',
			q: {
				ids: 123,
				q2:{
					qq:'qqqqqq'
				}
			},
			arr:[1,2,3,4]

		}
		var obj2 = {
			id: 2,
			name: 'rose'

		}

		// console.log(obj2.name,999);
/* 对象结构 和扩展运算符 */
		//var {id1,name,q:{ids}} = {...obj,...obj2} //  {id1:1,name1:jack,id:2,name:rose}
		var {id1,name,q:{ids,q2:{qq}},arr} = {...obj,...obj2} //  {id1:1,name1:jack,id:2,name:rose}
		//console.log(id1, name,ids,qq,arr);



/* 数组结构  和扩展运算符*/
		var  arr=[{id:11,name:'a'},	{id:22,name:'b'},{id3:3},{id4:4}]
		var  arr2=[{id5:5},{id6:6}]
		var  [{id},{id:ids},{},{id4},{},{id6}]=[...arr,...arr2] 
		 // [{id:11,name:'a'},	{id:22,name:'b'},{id3:3},{id4:4},{id5:3},{id6:4}] 
	//	console.log(id,ids,id4,id6);

// function  getList(option){
// 	$.ajax({
// 		url: 'http://api-breakingnews-web.itheima.net/my/article/list',
// 		type:'get',
// 		data:{
// 			pagenum:option.pagenum,
// 			pagesize:option.pagesize
// 		},
// 		headers:{
// 			Authorization:localStorage.getItem('token')
// 		},
// 		success:function(res){
// 					console.log(res,8888);
// 		},
// 	})
// }
// getList({pagenum:1,pagesize:5})


/* 2--- */
function  getList({pagenum,pagesize,state}){  //  getList(option){==
	$.ajax({
		url: 'http://api-breakingnews-web.itheima.net/my/article/list',
		type:'get',
		data:{
			pagenum:pagenum,
			pagesize:pagesize
		},
		headers:{
			Authorization:localStorage.getItem('token')
		},
		success:function({data,total}){
					console.log(data,total,8888);
		},
	})
}
getList({pagenum:1,pagesize:5,state:0})




	</script>
</body>

</html>
